import request from '@/utils/request'
export const BaseApi = {
  /**
	 * @desc 获取免登录访问需要的token
	 * @param {loginName} data
	 * @returns
	 * @auth zh wyj
	 */
	getToken(data) {
		return request({
			url: `/api/chroniccare/residents/getTokenByLoginName`,
			method: 'post',
			data
		})
	},
	/**
	 * @desc 获取tab缓存
	 * @param {idNumber} data
	 * @returns
	 * @auth zh wyj
	 */
	getTabCache(data) {
		return request({
			url: `/cd/clinic-in-helper/getTabCache`,
			method: 'post',
			data
		})
	},
	/**
	 * @desc 缓存tab
	 * @param {idNumber tabs： {isChecked, name}} data
	 * @returns
	 * @auth zh wyj
	 */
	saveTabCache(data) {
		return request({
			url: `/cd/clinic-in-helper/saveTabCache`,
			method: 'post',
			transformRequest: function(data) {
        return JSON.stringify(data)
      },
      headers: {
        'Content-Type': 'application/json'
      },
			data
		})
	}
}
